package com.gmq.javaMulti.chapter02;

/**
 * Created by gmq on 2018/10/06.
 *
 * @version 1.0
 * @since 2018/10/06 22:28
 */
public class JoinMain {

    public volatile static int i = 0;
    public static class AddThread extends Thread {
        @Override
        public void run() {
            for (i = 0; i < 10000000; i++);
        }
    }

    public static void main(String[] args) throws InterruptedException {
        AddThread at = new AddThread();
        at.start();
        at.join();
        System.out.println(i);
    }
}
